(function ($) {
	$.fn.productCategorySide=function(options){
                var $root=$(this);
                                
                var settings = $.extend({
                                        searchUrl:null
                                    }, options 
                                );
                                    
                $root.find('span.file').mouseover(function(){
                    var itemclass=$(this).attr('class');
                    itemclass+=' filehover';
                    
                    $(this).attr('class', itemclass);
                    $(this).unbind('mouseout').bind('mouseout', function(){
                        var itemclass=$(this).attr('class');
                        itemclass=itemclass.replace('filehover', '');
                        $(this).attr('class', itemclass);
                    });                    
                });     
                
                $root.find('span.file').click(function(){
                    if(settings.searchUrl!==null && settings.searchUrl!==''){
                        var catId=$(this).parent().attr('id').replace('node_', '');
                        window.location=settings.searchUrl.replace('_id_', catId);
                    }
                });
        };
})(jQuery);